{%extends "atletas/base.html"%}

{%block extrahead%}
    {% load static %}
    {% get_static_prefix as STATIC_PREFIX %}
    
    <link rel="stylesheet" href="{{ STATIC_PREFIX }}css/jquery/ui/jquery.ui.all.css">
    <link rel="stylesheet" type="text/css" media="screen" href="{{ STATIC_PREFIX }}css/jquery/ui/jquery-ui-1.8.16.custom.css" />
    
{%endblock%}

{% block breadcrumb %} <a href="/">Inicio</a> > <a href='/atletas/'>Atletas</a> > Federar atleta {% endblock %}

{%block content%}
<form action="" method="post">{% csrf_token %}
    <div id="main">
    <h2>Federar a atleta {{atleta}}</h2>
    
    <!-- agregado para multiselect -->
    <link type="text/css" href="{{ STATIC_PREFIX }}css/jquery/ui/jquery.ui.multiselect.css" rel="stylesheet" />
    <!--link type="text/css" rel="stylesheet" href="{{ STATIC_PREFIX }}css/jquery/ui/jquery.ui.all.css" /-->
    <script type="text/javascript" src="{{ STATIC_PREFIX }}js/jquery/jquery-1.7.min.js"></script>
    <script type="text/javascript" src="{{ STATIC_PREFIX }}js/jquery/ui/jquery-ui-1.8.12.custom.min.js"></script>
    <script type="text/javascript" src="{{ STATIC_PREFIX }}js/jquery/ui/ui.multiselect.js"></script>

    <script type="text/javascript">
        $(function(){
            $(".multiselect").multiselect();        
        });
    </script>
    <!-- agregado para multiselect -->
    
    <select id="tags" name="deportes[]" class="multiselect" multiple="multiple" >
    {% for deporte in deportes %}
        {% if not deporte.datos_requeridos %}
            {% ifequal deporte.checked 'no'%}
                <option value="{{deporte.pk}}"><label>{{deporte.nombre}}</label>
            {% else %}
                <option value="{{deporte.pk}}" selected><label>{{deporte.nombre}}</label>
            {% endifequal %}
        {% endif %}
    {% endfor %}
    </select>
    
    </div>
    
    <h3>El atleta tiene datos faltantes en los siguientes deportes</h3>
    
    <div>
        <ul>
            {% for deporte in deportes %}
                {% if deporte.datos_requeridos %}
                <li>{{deporte.nombre}}</li>
                <ul>
                    {% for dato in deporte.datos_requeridos %}
                    <li>{{dato}}</li>
                    {% endfor %}
                </ul>
                {% endif %}
            {% endfor %}
        </ul>
    </div>
    
    
    
    <div class='buttons' align='right'>
        <input type='submit' class='savebuton'   value='Guardar' name='boton_guardar'>
        <input type='submit' class='savebuton'   value='Guardar y continuar editando' name='boton_guardar_y_editar'>
        <input type='submit' class='savebuton'   value='Editar Atleta'   name='boton_editar_atleta'">
        <input type='submit' class='cancelbuton' value='Cancelar' name='boton_cancelar'>
    </div>
</form>
{%endblock%}
